Cardset format version 7 - cardset subtype and joker deck support #330
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a pretty big refactor, so I'm doing this as a PR. Also, I have some plans to build off this further, so I consider this to be the point of no return for my 3.0 plans (mentioned in ticket #296).
This PR introduces cardsets version 7, which allows the option to have cardset subtypes. This allows more complex rules regarding which cardsets can be used for each game without requiring creating new main types, for cases where the differences between cardsets are minor. For this initial build, I used this to add support for French joker decks. If a game requires jokers, it must use a deck that contains jokers, but if the game does not require jokers, it doesn't matter whether the deck uses them or not. I do not want cardsets to require jokers, as this would render most of the old cardsets incompatible. This is done by making a French joker deck as a subtype.
I feel this is a little hacky in a couple places - most of this is where I was trying not to break existing options config files or cardsets.
I also changed the way Mahjongg cardsets use version 6, so version 7 cardsets aren't forced to use one set of 3D Mahjongg placement logic.
Attached is a copy of my Neo cardset updated to version 7, with jokers added. Anyone who wants to test can use this to do so. I've also found the matching jokers for many of the existing cardsets and will add them to the cardsets repo when I update those to version 7 later.
I added the game "Thieves" to help test this. Thieves is a variation of Golf from Gnome AisleRiot that implements the jokers, which are wild cards (they can be played on any card, and any card can be played on them). I may rename this game "Joker Golf" later (leaving "Thieves" as an alternate name), depending what other joker deck games we add later.
cardset-neo.zip